package java_io.reading_writing_console;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.System.out;

/*
 * The following program demonstrates BufferedReader and the readLine( ) method.
 * The program reads and displays lines of text until you enter the word "end":
 */
public class BufferedReadLines {
	public static void main(String args[]) throws IOException
	   {
	      // Create a BufferedReader using System.in
	      BufferedReader br = new BufferedReader(new
	                              InputStreamReader(System.in));
	      String str;
	      out.println("Enter lines of text.");
	      out.println("Enter 'end' to quit.");
	      do {
	         str = br.readLine();
	         out.println(str);
	      } while(!str.equals("end"));
	   }
}
